<template>
  <div>
    <van-cell title="点击选择预约时间" :value="date" @click="showon = true" />
    <van-calendar v-model="showon" @confirm="onConfirm" />
  </div>
</template>



<script>
export default {
  data() {
    return {
      //日历
      date: '',
      // arrrl:[],
      showon: false,
    }
  },
  methods: {
     //日日日日日日历
        formatDate(date) {
          return `2021年${date.getMonth() + 1}月${date.getDate()}日`;
        },
        onConfirm(date) {
          let rl = this.$store.state.arrrl;
          this.showon = false;
          this.date = this.formatDate(date);
          if(rl!==''){
            rl.push(this.date);
          }
          // console.log(rl)
        },
  },
}
</script>



<style scoped>


</style>
